/*
 * Copyright 2022 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.mx.ymate.netty;

import io.netty.channel.ChannelInboundHandlerAdapter;
import net.ymate.platform.core.beans.annotation.Ignored;
import net.ymate.platform.core.support.IInitialization;

import java.util.List;

/**
 * INettyConfig generated By ModuleMojo on 2022/07/07 10:19
 *
 * @author YMP (https://www.ymate.net/)
 */
@Ignored
public interface INettyConfig extends IInitialization<INetty> {

    String ENABLED = "enabled";
    String CLIENT = "client";

    String AUTO_START = "autoStart";
    String SERVER_PORT = "server.port";
    String SERVER_START_PORT = "server.startPort";
    String SERVER_END_PORT = "server.endPort";
    String SERVER_EXCLUDE_PORT = "server.excludePort";
    String SERVER_HEART_BEAT_TIME = "server.heartBeatTime";
    String SERVER_HANDLER_CLASS = "server.handlerClass";
    String SERVER_DECODER_CLASS = "server.decoderClass";
    String CLIENT_REMOTE_ADDRESS = "client.remoteAddress";
    String CLIENT_HEART_BEAT_TIME = "client.heartBeatTime";
    String CLIENT_HANDLER_CLASS = "client.handlerClass";
    String CLIENT_DECODER_CLASS = "client.decoderClass";

    String SERVER_CLIENT_SERVER = "server";
    String SERVER_CLIENT_CLIENT = "client";

    /**
     * 模块是否已启用, 默认值: true
     *
     * @return 返回false表示禁用
     */
    boolean isEnabled();

    /**
     * 是否自动启动
     * @return
     */
    Boolean autoStart();

    /**
     * #启动的客户端 all全部 server服务端  client 客户端  默认all
     *
     * @return
     */
    String client();

    /**
     * 服务端端口 优先级最高
     */
    Integer serverPort();

    /**
     * 服务端开始端口 指定port了 以port为准
     */
    Integer serverStartPort();

    /**
     * 服务端结束端口 指定port了 以port为准
     */
    Integer serverEndPort();

    /**
     * 心跳维护时间 默认不维护
     */
    Integer serverHeartBeatTime();

    /**
     * 排除端口 用,号分割 只针对startPort endPort有效
     */
    List<String> serverExcludePort();

    /**
     * 处理器名称 可以指定多个用,号分割 按顺序添加
     */
    List<ChannelInboundHandlerAdapter> serverHandler();

    /**
     * 编解码名称 只能指定一个
     */
    ChannelInboundHandlerAdapter serverDecoder();


    /**
     * 远程连接地址 ip:port  多个用逗号分割
     */
    List<String> clientRemoteAddress();


    /**
     * 心跳维护时间 默认不维护
     */
    Integer clientHeartBeatTime();


    /**
     * 处理器名称 可以指定多个用,号分割 按顺序添加
     */
    List<ChannelInboundHandlerAdapter> clientHandler();

    /**
     * 编解码名称 只能指定一个
     */
    ChannelInboundHandlerAdapter clientDecoder();

}